clipboard: Fix a crash when GdkContentProviderUnion doesn't support the given data...
authorCarlos Garcia Campos <cgarcia@igalia.com>
Thu, 25 Mar 2021 14:10:00 +0000 (15:10 +0100)
committerCarlos Garcia Campos <cgarcia@igalia.com>
Thu, 25 Mar 2021 14:10:00 +0000 (15:10 +0100)
After iterating all the providers, all of them returning unsupported
error, gdk_content_provider_union_get_value() returns FALSE without
filing the given GError. Then gdk_clipboard_read_value_internal()
assumes there's a GError when FALSE is returned and
g_task_return_error() fails. We can just chain up to parent
implementation to ensure the GError is filled with unsupported error.

gdk/gdkcontentproviderimpl.c

index df9525e9e6e6db3d2c70e5df72280f479dbbcea0..9c337c7b7728f9685d9e403a60086f7070de0157 100644 (file)
@@ -349,7 +349,7 @@ gdk_content_provider_union_get_value (GdkContentProvider  *provider,
       g_clear_error (&provider_error);
     }
 
-  return FALSE;
+  return GDK_CONTENT_PROVIDER_CLASS (gdk_content_provider_union_parent_class)->get_value (provider, value, error);
 }
 
 static void